home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagg_m.zip
/
MEMORY.SWG
/
0065_DS and ES Registers.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-08-26
|
716b
|
35 lines
{
ET> On entry in an assembler routine, I haven't (yet?) noticed a
ET> difference between the DS and ES registers. Can I rely on that??
No. You can assume ES to be uninitialized (ie, random value), and
DS pointing to the program's data segment.
Try this and see for yourself :-)
Note that if you change "b^:=a" to "a:=b^", DS and ES hold the same
value when entering ShowESAndDS.
}
Var a : String ;
b : ^String ;
Procedure ShowESAndDS ;
Var _ES,
_DS : Word ;
Begin
Asm
Mov _ES, ES
Mov _DS, DS
End ;
WriteLn('ES=', _ES, ', DS=', _DS) ;
End ;
Begin
New(b) ;
b^:=a ;
ShowESAndDS ;
Dispose(b) ;
End.